summaryrefslogtreecommitdiff
path: root/ui/routes/(app)/ch/[channel]/+page.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'ui/routes/(app)/ch/[channel]/+page.svelte')
-rw-r--r--ui/routes/(app)/ch/[channel]/+page.svelte6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte
index ea8cca6..76bb638 100644
--- a/ui/routes/(app)/ch/[channel]/+page.svelte
+++ b/ui/routes/(app)/ch/[channel]/+page.svelte
@@ -46,8 +46,10 @@
function setLastRead() {
const lastInView = getLastVisibleMessage();
- const at = !!lastInView ? DateTime.fromISO(lastInView.dataset.at) : channel.at;
- session.local.updateLastReadAt(channelId, at);
+ const at = !!lastInView ? DateTime.fromISO(lastInView.dataset.at) : channel?.at;
+ if (!!at) {
+ session.local.updateLastReadAt(channelId, at);
+ }
}
$effect(() => {